
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface UIColor (Extend)


/// 通过字符串获取颜色
/// @param hexRGBString 16进制字符串
+ (UIColor *)colorWithHexString:(NSString *)hexRGBString;

+ (UIColor *)colorWithHexString:(NSString *)hexRGBString alpha:(CGFloat)alpha;

///值不需要除以255.0
+ (UIColor *)colorWithWholeRed:(CGFloat)red
                             green:(CGFloat)green
                              blue:(CGFloat)blue
                             alpha:(CGFloat)alpha;
///值不需要除以255.0
+ (UIColor *)colorWithWholeRed:(CGFloat)red
                             green:(CGFloat)green
                              blue:(CGFloat)blue;

/**
 *  返回颜色值
 */
- (NSString *)hexColorString;

@end

NS_INLINE UIColor * UIColor_Hex(NSString * colorStr) {
    return [UIColor colorWithHexString:colorStr];
}

NS_INLINE UIColor * UIColor_HexA(NSString * colorStr, CGFloat alpha) {
    return [UIColor colorWithHexString:colorStr alpha:alpha];
}

NS_INLINE UIColor * UIColor_RGB(CGFloat red, CGFloat green, CGFloat blue) {
    return [UIColor colorWithWholeRed:red green:green blue:blue];
}

NS_INLINE UIColor * UIColor_RGBA(CGFloat red, CGFloat green, CGFloat blue,  CGFloat alpha) {
    return [UIColor colorWithWholeRed:red green:green blue:blue alpha:alpha];
}

NS_ASSUME_NONNULL_END
